#include <stdio.h>
#include <unistd.h>
#include <signal.h>

void handler(int signo)
{
  printf("get a signal: signal no is:%d",signo , getpid());
}


int main()
{
  //replace 2 signal 
  signal(2 , handler);


  while(1)
  {
    printf("hello world! my pid is : %d\n" , getpid());
    sleep(1);
  }
  return 0;
}
